<div id="profilePicture">
    <?php
    list($width, $height, $type, $attr) = getimagesize($imgsrc);
    if ($width > 200 && $width > $height) {
        $height = $height / $width * 200;
        $width = 200;
    } else if ($height > 200 && $height >= $width) {
        $width = $width / $height * 200;
        $height = 200;
    } else if ($height < 200 && $weight < 200 & $height < $weight) {
        $height = $height / $width * 200;
        $width = 200;
    } else if ($height < 200 && $weight < 200 & $height >= $weight) {
        $width = $width / $height * 200;
        $height = 200;
    }
    echo "<img src=\"" . $imgsrc . "\" border=\"0\" width =\"$width\" height=\"$height\" alt=\"Profile Pic\"/>";
    ?>
</div>
